//
//  MyFirstTouchAppDelegate.m
//  MyFirstTouch
//
//  Created by acco on 08/03/08.
//  Copyright __MyCompanyName__ 2008. All rights reserved.
//

#import "MyFirstTouchAppDelegate.h"
#import "MyMelody.h"

@implementation MyFirstTouchAppDelegate

@synthesize window;
@synthesize contentView;


- (void)applicationWillTerminate:(UIApplication *)application
{
	[MyMelody finalize];
}

- (void)applicationDidFinishLaunching:(UIApplication *)application 
{	

	[MyMelody initialize];
	// Create window
	self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    
    // Set up content view
	self.contentView = [[[MyView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
	[window addSubview:contentView];

	// set background image filename
	
	UIImage *bgImg = [UIImage imageNamed:@"DSC_0296.JPG"];
	if(bgImg) {
		[contentView setBackGroundImage:bgImg];		
	}

	// init Score data
	[contentView initScore:12 numOfScore:16];
	
	// Show window
	[window makeKeyAndVisible];
	
 
}

- (void)dealloc {
	[contentView release];
	[window release];
	[super dealloc];
}



@end
